<!--D:\Test1\gitTest\smartgrid-ops\src\main\resources\static\user.htmlD:\Test1\gitTest\smartgrid-ops\src\main\resources\static\user.html-->
<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title><slot name="pageTitle">备件管理系统</slot></title>
  <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
  <link rel="icon" href="img/favicon.ico" type="image/x-icon">
  <style>
    body {
      margin: 0;
      font-family: Arial, sans-serif;
      background-color: #f5f7fa;
    }
    .header {
      background-color: #007bff;
      color: white;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 20px;
    }
    .footer {
      text-align: center;
      padding: 10px;
      background-color: #333;
      color: white;
    }
  </style>
</head>
<body>
<div id="app">
  <header class="header">
    <h2 style="margin: 0;"><slot name="pageHeader">备件管理系统</slot></h2>
    <el-button type="info" size="small" @click="logout">退出</el-button>
  </header>
  <main>
    <slot name="content"></slot>
  </main>
  <footer class="footer">
    &copy; 2025 备件管理系统 - 版权所有
  </footer>
</div>

<!-- 引入 Vue + Axios + Element Plus -->
<script src="https://unpkg.com/vue@3.2.36/dist/vue.global.prod.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/element-plus"></script>

<script>
  const { createApp } = Vue;

  const app = createApp({
    data() {
      return {};
    },
    methods: {
      logout() {
        window.location.href = '/login.html';
      }
    }
  });

  app.use(ElementPlus);
  app.mount('#app');
</script>
</body>
</html>